package com.snj.visangedu;

import java.lang.reflect.Array;
import java.util.ArrayList;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;

class TestFragmentAdapter2 extends FragmentPagerAdapter {
	protected static final String[] CONTENT = new String[] { "prev", "current", "next"};
	protected static final int[] POSITION = new int[] { 0, 0, 0};
	
	public static ArrayList<String> contenturls = new ArrayList<String>();
	

	public TestFragmentAdapter2(FragmentManager fm) {
		super(fm);
		
	}
	
	public void SetDataset(String prev, String current, String next, int prevposition, int currentposition, int nextposition)
	{
		CONTENT[0] = prev;
		CONTENT[1] = current;
		CONTENT[2] = next;
		
		
		
		POSITION[0] = prevposition;
		POSITION[1] = currentposition;
		POSITION[2] = nextposition;
		
		Log.d("ContentFragment", prev + ", " + current + ", " + next + ", " + prevposition + ", " + currentposition + ", " + nextposition);
	}
	

	@Override
	public Fragment getItem(int position) {
		
		return ContentFragment2.newInstance(CONTENT[position], POSITION[position], position);
	}

	@Override
	public int getCount() {
		if(CONTENT[2] == null)	return 2;
		return CONTENT.length;
	}
	
	
}